<?php
 
my_component_load('testing' , false);
my_component_load('paging' , false); 
my_component_load('pr_yearly_income_slip');
$task = isset($_GET['task']) ? $_GET['task'] : ""; 
$karyawan_id = isset( $_GET['karyawan_id'] ) ? $_GET['karyawan_id'] :  0;
$modulname = "Reporting _BN_ Penggajian _BN_ Yearly Income";

if($task == "plaincetak"){
	@ob_end_clean(); 
	echo'<pre>';
	echo print_plain($karyawan_id);
	exit;
}elseif($task == "cetak_all"){

$known_mime_types=array(
 	"pdf" => "application/pdf",
 	"txt" => "text/plain",
 	"html" => "text/html",
 	"htm" => "text/html",
	"exe" => "application/octet-stream",
	"zip" => "application/zip",
	"doc" => "application/msword",
	"xls" => "application/vnd.ms-excel",
	"ppt" => "application/vnd.ms-powerpoint",
	"gif" => "image/gif",
	"png" => "image/png",
	"jpeg"=> "image/jpg",
	"jpg" =>  "image/jpg",
	"php" => "text/plain"
 );
 
 if($mime_type==''){
	 $file_extension = strtolower(substr(strrchr($file,"."),1));
	 if(array_key_exists($file_extension, $known_mime_types)){
		$mime_type=$known_mime_types[$file_extension];
	 } else {
		$mime_type="application/force-download";
	 };
 };
 
 @ob_end_clean();
header('Content-Type: text/plain' );
 header('Content-Disposition: attachment; filename="slip_yearly_income_'.date('mY').'_'.rand(1000,9999).'.txt"');
 header("Content-Transfer-Encoding: binary");
 header('Accept-Ranges: bytes'); 
 header("Cache-control: private");
 header('Pragma: private');
 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
	@ob_end_clean(); 
	 
	echo print_all();
	exit;	
}else{
	$pagename = $modulname;
	load_facebox_script();
	$content =  list_data();
}	
generate_my_web($content, $pagename  );